import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: DELL
 * Date: 2023-03-16
 * Time: 11:52
 */
public class Test_23_0316 {

    public static int binarySeach(int[] array, int key) {
        int left = 0;
        int right = array.length;
        while(left <= right) {
            int mid = (left + right) >>> 1;
            if(array[mid] < key) {
                left = mid +1;
            }else if(array[mid] > key) {
                right = mid -1;
            }else {
                return mid;
            }
        }
        return -1;
    }

    public static void main1(String[] args) {
        int[] s = new int[] {12,46,34,32,8};
//        Arrays.sort(s);
//        System.out.println(Arrays.toString(s));
//        int x = Arrays.binarySearch(s, 19);
        //System.out.println(x);

        int[] array = new int[] {1,2,3,4};
        int a = 10;
        double b = 9.9;
        System.out.println(array);

    }



    public static void main2(String[] args) {
        int[] array = new int[] {1,2,3,4,5};
        // 数组转换字符串
        System.out.println(Arrays.toString(array));

    }

    public static void main(String[] args) {
//        int[] array = new int[] {1,2,3,4};
//        fun1(array);
//        System.out.println(Arrays.toString(array));
//        fun2(array);
//        System.out.println(Arrays.toString(array));


    }

    public static void fun1(int[] array) {
        array = new int[10];
    }

    public static void fun2(int[] array) {
        array[1] = 99;
    }
}
